<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
      
<h:head>
	<title>Modifica Escursioni</title>
	<link href="resources/css/main.css" rel="stylesheet" type="text/css" />
</h:head>  
<h:body>
	<header>
		<a><h:link class="logo" outcome="index" /></a>
	</header>
	<div id="container">
		<div id="content1">
			<div id="contentLarge">
	<h:form id="form" onsubmit="#{beanProdottoBase.retrieveEscursioni()}">
		
		<p:growl id="messages" showDetail="true"/>
		
		<p:dataTable id="dataTableEscursioni" var="escursioni" value="#{beanProdottoBase.listaEscursioni}" widgetVar="escursioniTable"   
		            emptyMessage="Nessuna escursione trovata per i parametri specificati." rowKey="#{escursioni.codice}"
		            editable="true" filteredValue="#{Retriever.escursioniFiltrate}">
		            
		            
		  		<f:facet name="header">
          			 Cerca, modifica ed elimina escursioni
        		</f:facet> 
        		
        		<p:ajax event="rowEdit" listener="#{beanProdottoBase.updateEscursione}" update=":form:messages" />  
       			<p:ajax event="rowEditCancel" listener="#{beanProdottoBase.deleteEscursione}" update=":form:messages" />
		  
		  		
		  		
		        <p:column id="nomeEscursione" filterBy="nome"   
		                headerText="Nome"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{escursioni.nome}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{escursioni.nome}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        
<!-- 		        <p:column id="durataEscursione" filterBy="durata"    -->
<!-- 		                headerText="Durata" -->
<!-- 		                filterMatchMode="contains">   -->
<!-- 		            <p:cellEditor>   -->
<!--                 		<f:facet name="output">   -->
<!--                     		<h:outputText value="#{escursioni.durata}" />   -->
<!--                 		</f:facet>   -->
<!--                 		<f:facet name="input">   -->
<!--                     		<p:inputText value="#{escursioni.durata}"/> -->
<!--                 		</f:facet>   -->
<!--             		</p:cellEditor>   -->
<!-- 		        </p:column> -->
		        
		        <p:column id="luogoPartenzaEscursione" filterBy="luogoPartenza"   
		                headerText="Luogo partenza"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{escursioni.luogoPartenza}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{escursioni.luogoPartenza}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column id="prezzoEscursione" filterBy="prezzo"   
		                headerText="Prezzo"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
                		<f:facet name="output">  
                    		<h:outputText value="#{escursioni.prezzo}" />  
                		</f:facet>  
                		<f:facet name="input">  
                    		<p:inputText value="#{escursioni.prezzo}"/>
                		</f:facet>  
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column id="stagioneEscursione" filterBy="stagione"   
		                headerText="Stagione"
		                filterMatchMode="contains">  
		            <p:cellEditor>   
                		<f:facet name="output">  
                    		<p:inputText value="#{escursioni.stagione}"/>
                		</f:facet>
                		<f:facet name="input">
                			<p:selectOneListbox id="stagione" value="#{escursioni.stagione}">
							 	<f:selectItem itemLabel="Qualsiasi" itemValue="Qualsiasi" />  
			           			<f:selectItem itemLabel="Inverno" itemValue="Inverno" />  
			           		 	<f:selectItem itemLabel="Primavera" itemValue="Primavera" />  
			           			<f:selectItem itemLabel="Estate" itemValue="Estate" />
			           			<f:selectItem itemLabel="Autunno" itemValue="Autunno" />
                    		</p:selectOneListbox>  
                		</f:facet> 
            		</p:cellEditor>  
		        </p:column>
		        
		        <p:column id="tipologiaEscursione" filterBy="tipologia"   
		                headerText="Tipologia"
		                filterMatchMode="contains">  
		            <p:cellEditor>  
		            	<f:facet name="output">  
                    		<p:inputText value="#{escursioni.tipologia}"/>
                		</f:facet> 
                		<f:facet name="input">
                			<p:selectOneListbox id="tipologia" value="#{escursioni.tipologia}">
							 	<f:selectItem itemLabel="Seleziona" itemValue="" />  
				           		<f:selectItem itemLabel="Culturale" itemValue="Culturale" />  
				           		<f:selectItem itemLabel="Sportiva" itemValue="Sportiva" />  
				           		<f:selectItem itemLabel="Didattica" itemValue="Didattica" />
                    		</p:selectOneListbox>  
                		</f:facet>  
                		 
            		</p:cellEditor>  
		        </p:column>
		        
		        
		        <p:column style="width:6%">  
           			<p:rowEditor />  
        		</p:column>
		          
		    </p:dataTable> 
	</h:form>
	</div>
	</div>
	<a><h:link class="button1" outcome="modificaProdottoBase" value="Indietro"/></a>
	</div>
	<h:outputStylesheet library="css" name="main.css"/>
</h:body>
       
</html>